<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/cms/include/init_admin.jsp" %>
<%@ page import="com.qbooks.cms.admin.*" %>
<%
	HashList codeUseYn	= CommonUtil.getCodeList("use_yn");	//

	String app_id		= StringUtil.nvl(request.getParameter("app_id"));
	String history_seq	= StringUtil.nvl(request.getParameter("history_seq"),"X");

	String job_type		= "";
	
	if ("X".equals(history_seq)) {
		job_type = "C";
	} else {
		job_type = "U";
	}
	
	
	HashMap infos 		= new HashMap();
	infos.put("app_id",	app_id);
	infos.put("history_seq", history_seq);

	AdminDAO dao 		= new AdminDAO();
	HashList info		= dao.selectAppHistoryList(infos);	

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/cms/include/cssnjs.jsp"  %>
	<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="/SE2.3.1.O9858/js/HuskyEZCreator.js" charset="utf-8"></script>

	<script type="text/javascript">
	var oEditors = [];

	$(document).ready(function() {

	});


	function fnSave() {
		if (confirm(MSG_<%=job_type%>)) {
			if (document.historyForm.job_type.value == "C") {
				$('#target').val('_opener');
			} 
			$('#historyForm').submit();
		}
	}


	function fnDelete() {
		if (confirm(MSG_D)) {
			$('#job_type').val('D');
			$('#target').val('_opener');
			$('#historyForm').submit();
		}
	}

	</script>
</head>
<body>
<div id="popup">
			<div class="menu_title">
				<h1>업데이트 이력</h1>
			</div>
			
				<form id="historyForm" name="historyForm" method="post" enctype="multipart/form-data"  action="./appHistorySave.do">
				<input type="hidden" name="job_type" id="job_type" value="<%= job_type %>"/>
				<input type="hidden" name="app_id" value="<%= app_id %>" />
				<input type="hidden" name="history_seq" value="<%= history_seq %>" />
				<input type="hidden" name="target" id="target" value=""/>
				
				<table cellpadding="0" cellspacing="0" class="table_01 mt5">
				<colgroup>
					<col width="100px"/>
					<col/>
				</colgroup>
				
				<tbody>
					<tr>
						<th><p>버전</p></th>
						<td class="brx">
							<input type="text" name="version" value="<%= info.get("version", 0) %>" class="w200"/>
						</td>
					</tr>
					<tr>
						<th><p>APK</p></th>
						<td class="brx">
							<input type="file" name="download_url" value="<%= info.get("download_url", 0) %>" class="wmax"/>
						</td>
					</tr>
					<tr>
						<th><p>설명</p></th>
						<td class="brx">
							<textarea name="remarks" rows="10" class="wmax"><%= info.get("remarks", 0) %></textarea>
						</td>
					</tr>
					<tr>
						<th><p>사용여부</p></th>
						<td class="brx">
							<%= StringUtil.makeRadio(codeUseYn, "use_yn", StringUtil.nvl(info.get("use_yn",0),"Y")) %>
						</td>
					</tr>
				</tbody> 
				</table>

				<div class="mt20 mb10 c">
					<a href="#nohref" onclick="fnSave()"><img src="../images/btn_save.gif" /></a>
					<a href="#nohref" onclick="fnDelete()"><img src="../images/btn_delete.gif" /></a>
					<a href="#nohref" onclick="self.close()"><img src="../images/btn_close.gif" /></a>
				</div>
				

				</form>



</div>

</body>
</html>
